05. Quiz: Creating and Saving NumPy ndarrays
Quiz: ABC's
Create a numpy array of strings containing letters 'a' through 'j' (inclusive) of the alphabet. Then, use numpy array attributes to print the following information about this array:
- dtype of array
- shape of array
- size of array
The code you submit in the code editor below will not be graded. Use the results from your code below, along with what you remember from the previous video, to complete the quiz below the code editor.
Start Quiz:
import numpy as np
# create numpy array of letters a-j
letter_array =
print("Letter Array: ", letter_array)
# get dtype of array
# get shape of array
# get size of array
QUIZ QUESTION::
Match the correct value for each of the following properties of letter_array
.
ANSWER CHOICES:
Properties |
Value |
---|---|
str |
|
(1, 10) |
|
(10, 1) |
|
10 |
|
ndarray |
|
int |
|
(10,) |
|
26 |
SOLUTION:
Properties |
Value |
---|---|
str |
|
10 |
|
ndarray |
|
(10,) |